<script setup lang="ts">
import {useRoute} from "vue-router";
import {onMounted, ref, watch} from "vue";
const route = useRoute()

let cs = ref<any>([])

onMounted(() => {
  buildCs()
})

watch(() => route.path, (newVal,oldValue) => {
  buildCs()
})

const buildCs = () => {
  cs.value = route.matched.map(item => item)
}
</script>
<template>
  <el-breadcrumb style="padding: 14px 20px">
    <el-breadcrumb-item v-for="item in cs">{{item.meta.title}}</el-breadcrumb-item>
  </el-breadcrumb>
</template>
<style scoped></style>